package com.safewind.util;

import java.io.IOException;
import java.util.Properties;

import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.EncodedResource;
import org.springframework.core.io.support.PropertiesLoaderUtils;

public class PropertiesUtil {

	private static String fileNamePath = "sms.properties";
	private static Properties properties = null;
	static {
		Resource resource = new ClassPathResource(fileNamePath);
		EncodedResource encodedResource = new EncodedResource(resource, "UTF-8");

		try {
			properties = PropertiesLoaderUtils.loadProperties(encodedResource
					.getResource());
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public static String getValue(String key) {
		return properties.getProperty(key);
	}
}
